const { defineConfig } = require('@vue/cli-service')
const registerRouter = require('./backend/router')

module.exports = defineConfig({
  css: {
    loaderOptions: {
      sass: {
        // 全局引入变量和mixin
        additionalData: `
        @import "@/assets/scss/variable.scss";
        @import "@/assets/scss/mixin.scss";`
      }
    }
  },
  devServer: {
    setupMiddlewares: (middlewares, devServer) => {
      // 注册你的自定义中间件
      registerRouter(devServer.app)
      // 调用默认的中间件设置
      return middlewares
    }
  }
})
